Builder

General strategy of building is to only offer additive “or” operations that are chained together. Any more complex operations can be performed by the developer providing their own custom Predicate.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
@NonNull
open fun allowAction(@NonNull filter: @NonNull Predicate<String>): @NonNull IntentSanitizer.Builder
Add a filter for allowed actions.
@NonNull
open fun allowAction(@NonNull action: @NonNull String): @NonNull IntentSanitizer.Builder
Add an action to the list of allowed actions.
Link copied to clipboard
@NonNull
open fun allowAnyComponent(): @NonNull IntentSanitizer.Builder
Allow any components.
Link copied to clipboard
@NonNull
open fun allowCategory(@NonNull filter: @NonNull Predicate<String>): @NonNull IntentSanitizer.Builder
Add a filter for allowed categories.
@NonNull
open fun allowCategory(@NonNull category: @NonNull String): @NonNull IntentSanitizer.Builder
Add a category to the allowed category list.
Link copied to clipboard
@NonNull
open fun allowClipData(@NonNull filter: @NonNull Predicate<ClipData>): @NonNull IntentSanitizer.Builder
Allows clipData that passes the given filter.
Link copied to clipboard
@NonNull
open fun allowClipDataText(): @NonNull IntentSanitizer.Builder
Allows clipData that contains text.
Link copied to clipboard
@NonNull
open fun allowClipDataUri(@NonNull filter: @NonNull Predicate<Uri>): @NonNull IntentSanitizer.Builder
Allows clipData whose items URIs pass the given URI filter.
Link copied to clipboard
@NonNull
open fun allowClipDataUriWithAuthority(@NonNull authority: @NonNull String): @NonNull IntentSanitizer.Builder
Allows clipData whose items URIs authorities match the given authority.
Link copied to clipboard
@NonNull
open fun allowComponent(@NonNull component: @NonNull ComponentName): @NonNull IntentSanitizer.Builder
Add a component to the allowed components list.
@NonNull
open fun allowComponent(@NonNull filter: @NonNull Predicate<ComponentName>): @NonNull IntentSanitizer.Builder
Add a filter for allowed components.
Link copied to clipboard
@NonNull
open fun allowComponentWithPackage(@NonNull packageName: @NonNull String): @NonNull IntentSanitizer.Builder
Allow any component under the specified package.
Link copied to clipboard
@NonNull
open fun allowData(@NonNull filter: @NonNull Predicate<Uri>): @NonNull IntentSanitizer.Builder
Allow data that passes the filter test.
Link copied to clipboard
@NonNull
open fun allowDataWithAuthority(@NonNull authority: @NonNull String): @NonNull IntentSanitizer.Builder
Convenient method to allow all data whose URI authority equals to the given.
Link copied to clipboard
@NonNull
open fun allowExtra(@NonNull key: @NonNull String, @NonNull filter: @NonNull Predicate<Any>): @NonNull IntentSanitizer.Builder
Allows an extra member whose key matches the given key and whose value passes the filter test.
@NonNull
open fun allowExtra(@NonNull key: @NonNull String, @NonNull clazz: @NonNull Class<out Any>): @NonNull IntentSanitizer.Builder
Allows an extra member whose key and type of value matches the given.
open fun <T> allowExtra(@NonNull key: @NonNull String, @NonNull clazz: @NonNull Class<T>, @NonNull valueFilter: @NonNull Predicate<T>): @NonNull IntentSanitizer.Builder
Allows an extra member whose key matches the given key and whose value is of the type of the given clazz and passes the value filter.
Link copied to clipboard
@NonNull
open fun allowExtraOutput(@NonNull filter: @NonNull Predicate<Uri>): @NonNull IntentSanitizer.Builder
@NonNull
open fun allowExtraOutput(@NonNull uriAuthority: @NonNull String): @NonNull IntentSanitizer.Builder
Allows an extra member with the key MediaStore.EXTRA_OUTPUT.
Link copied to clipboard
@NonNull
open fun allowExtraStream(@NonNull filter: @NonNull Predicate<Uri>): @NonNull IntentSanitizer.Builder
Allows an extra member with the key Intent.EXTRA_STREAM.
Link copied to clipboard
@NonNull
open fun allowExtraStreamUriWithAuthority(@NonNull uriAuthority: @NonNull String): @NonNull IntentSanitizer.Builder
Allows an extra member with the key Intent.EXTRA_STREAM.
Link copied to clipboard
@NonNull
open fun allowFlags(flags: Int): @NonNull IntentSanitizer.Builder
Sets allowed flags.
Link copied to clipboard
@NonNull
open fun allowHistoryStackFlags(): @NonNull IntentSanitizer.Builder
Adds all history stack flags into the allowed flags set.
Link copied to clipboard
@NonNull
open fun allowIdentifier(): @NonNull IntentSanitizer.Builder
Allows any identifier.
Link copied to clipboard
@NonNull
open fun allowPackage(@NonNull filter: @NonNull Predicate<String>): @NonNull IntentSanitizer.Builder
Add a filter for allowed packages.
@NonNull
open fun allowPackage(@NonNull packageName: @NonNull String): @NonNull IntentSanitizer.Builder
Add a package to the allowed packages.
Link copied to clipboard
@NonNull
open fun allowReceiverFlags(): @NonNull IntentSanitizer.Builder
Adds all receiver flags into the allowed flags set.
Link copied to clipboard
@NonNull
open fun allowSelector(): @NonNull IntentSanitizer.Builder
Allow any selector.
Link copied to clipboard
@NonNull
open fun allowSourceBounds(): @NonNull IntentSanitizer.Builder
Allow any source bounds.
Link copied to clipboard
@NonNull
open fun allowType(@NonNull filter: @NonNull Predicate<String>): @NonNull IntentSanitizer.Builder
Add a filter for allowed data types.
@NonNull
open fun allowType(@NonNull type: @NonNull String): @NonNull IntentSanitizer.Builder
Add a data type to the allowed type list.
Link copied to clipboard
@NonNull
open fun build(): @NonNull IntentSanitizer
Build the IntentSanitizer.